//
//  LoginTableViewCell.m
//  SafeFoodManagerDemo
//
//  Created by bob on 2017/10/9.
//  Copyright © 2017年 bob. All rights reserved.
//

#import "LoginTableViewCell.h"
@implementation LoginTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    [self.LoginTextFile setValue:[UIColor lightGrayColor] forKeyPath:@"_placeholderLabel.textColor"];
    
    // Initialization code
}

-(void)setModel:(LoginChooseModel *)model
{
    _model=model;
    
    self.TypeImageView.image=[UIImage imageNamed:model.imageMark];
    
    self.LoginTextFile.placeholder=model.ploacherText;
    
    self.LoginTextFile.text=model.userWrite;
    
    self.LoginTextFile.userInteractionEnabled=model.enable;
    
    self.LoginTextFile.secureTextEntry=model.isSecrue;
    
    if (!model.showArror) {
        
        self.arrowImageWidth.constant=0;
        
        self.ArrorImageView.hidden=YES;
    }else{
        
        self.arrowImageWidth.constant=20;
        self.ArrorImageView.hidden=NO;
        
        if (model.index==0) {
            
             self.ArrorImageView.image=[UIImage imageNamed:@"loginarror"];
            
        }else{
      
            if (model.isSecrue) {
                
             self.ArrorImageView.image=[UIImage imageNamed:@"pass_gone"];
                
            }else{
                
               self.ArrorImageView.image=[UIImage imageNamed:@"pass_visuable"];
                
            }
      
        }
    }
}




-(void)setIsChoose:(BOOL)isChoose
{
    _isChoose=isChoose;
    
    if (self.model.index==0) {
        
        if (isChoose) {
            
            self.ArrorImageView.image=[UIImage imageNamed:@"loginarrorup"];
            
        }else{
            
            self.ArrorImageView.image=[UIImage imageNamed:@"loginarror"];
            
        }
        
    }

}

-(void)setJmodel:(JobModel *)jmodel
{
    _jmodel=jmodel;
 
    self.LoginTextFile.text=jmodel.JobName;
    
    self.TypeImageView.image=[UIImage imageNamed:@""];
    
    self.ArrorImageView.hidden=YES;
    
    self.LoginTextFile.userInteractionEnabled=NO;
    
    self.LoginTextFile.secureTextEntry=NO;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
